package com.demo.student;

import com.demo.common.model.Student;
import com.jfinal.plugin.activerecord.Page;

/**
 * StudentService
 */
public class StudentService {

	private Student dao = new Student().dao();
	
	public Page<Student> paginate(int pageNumber, int pageSize) {
		return dao.paginate(pageNumber, pageSize, "select *", "from student order by id asc");
	}
	
	public Student findById(int id) {
		return dao.findById(id);
	}
	
	public void deleteById(int id) {
		dao.deleteById(id);
	}

	public void save(Student student) {
		student.save();
	}

	public void update(Student student) {
		student.update();
	}
}
